package com.ruoyi.quartz.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.AddWechat;
import com.ruoyi.system.domain.Favorites;
import com.ruoyi.system.enumutil.AddWechatEnum;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.AddWechatService;
import com.ruoyi.system.service.FavoritesService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import com.ruoyi.system.enumutil.SysUserEnum;

import java.util.List;
import java.util.Map;

/*
 *  @author 雨安
 *  类名： AddWechatController
 *  创建时间：2025/2/11
 */
@RestController
@RequestMapping("/sysUserMessage")
public class SysUserMessageController {

    //用户表
    @Resource
    private SysUserMapper sysUserMapper;

    //查询
    @PostMapping("/get/selectCount")
    public AjaxResult getSelectCount(){
        SysUser sysUser =  new SysUser();
        sysUser.setDelFlag("0");
        sysUser.setStatus(SysUserEnum.ZhuangtaiZhengchang.getStatus());
        //总用户
        Integer users = sysUserMapper.selectUserCount(sysUser);
        //查当日新增用户
        Integer dayusers = sysUserMapper.selectDayUser(sysUser);
        //查总余额
        Double balances = sysUserMapper.selectUserBalance(sysUser);
        //查当日充值
        Double daychongzhi = sysUserMapper.selectDayUserMoney(sysUser);
        //查总充值
        Double zchongzhi = sysUserMapper.selectUserMoney(sysUser);
        //查当日提现
        Double dayTx = sysUserMapper.selectDayUserWithdraw(sysUser);
        //查总提现
        Double zTx = sysUserMapper.selectUserWithdraw(sysUser);
        //查当月每天每日总用户
        List<Map<String,Double>> dayusersTu = sysUserMapper.selectUserDayTu(sysUser);
        //查当月每天每日充值
        List<Map<String,Double>> dayChongzhisTu = sysUserMapper.selectChongZhiDayTu(sysUser);
        System.out.println(dayusersTu);
        System.out.println(999);

        AjaxResult ajax = AjaxResult.success();
        ajax.put("users",users);
        ajax.put("dayusers",dayusers);
        ajax.put("balances",balances);
        ajax.put("daychongzhi",daychongzhi);
        ajax.put("zchongz",zchongzhi);
        ajax.put("dayTx",dayTx);
        ajax.put("zTx",zTx);
        ajax.put("dayusersTu",dayusersTu);
        ajax.put("dayChongzhisTu",dayChongzhisTu);
        return ajax;
    }



}
